/**
 * 
 */
package com.dsbridge.enrollment.business;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dsbridge.enrollment.entities.Student;
import com.dsbridge.enrollment.jpadao.StudentJPADAO;
import com.dsbridge.enrollment.model.StudentsDTO;

/**
 * @author rithvik
 *
 */
@Service("studentBusinessService")
public class StudentBusinessServiceImpl implements StudentBusinessService {

	@Autowired
	//private StudentDAO studentDAO;
	private StudentJPADAO studentJPADAO;
	
	/* (non-Javadoc)
	 * @see com.dsbridge.enrollment.business.CourseBusinessService#createCourse(java.lang.String, java.lang.String, int, int)
	 */
	@Override
	@Transactional
	public int createStudent(StudentsDTO studentsDTO) {
		Student student=new Student();
		student.setDateOfRegistration(studentsDTO.getRegistrationDate());
		student.setFirstName(studentsDTO.getFirstName());
		student.setLastLogin(studentsDTO.getLastLogin());
		student.setLastName(studentsDTO.getLastName());
		student.setPassword(studentsDTO.getPassword());
		student.setLoginName(studentsDTO.getLoginName());
		student.setMiddleName(studentsDTO.getMiddleName());
		return studentJPADAO.createStudent(student);
	}
	

}
